import 'package:flutter/material.dart';

class EgOpacity extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("透明度设置"),
      ),
      body: new Opacity(
        opacity: 0.5,
        child: new Container(
          width: 300,
          height: 300,
          decoration: new BoxDecoration(color: Colors.black, image: DecorationImage(image: ExactAssetImage("images/1.png"), fit: BoxFit.cover)),
          child: new Center(
              child: new Text(
            "不透明度0.5",
            style: TextStyle(color: Colors.white, fontSize: 28),
          )),
        ),
      ),
    );
  }
}
